/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DAO;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Administrator
 */
public abstract class BaseDAO {
    private Connection con;
    private static final String url = "jdbc:sqlserver://localhost:1433;databaseName=ExamOnline";
    private static final String user = "sa";
    private static final String pass = "1";
    public Connection getConnection()   {
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(url, user, pass);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return con;
    }
    
}
